package com.jyhs.maven.service.impl;


import com.jyhs.maven.dao.UserDao;
import com.jyhs.maven.dao.impl.UserDaoImpl;
import com.jyhs.maven.proxy.dynamic.JDKProxyFactory;
import com.jyhs.maven.entity.User;
import com.jyhs.maven.service.UserService;
import org.springframework.stereotype.Service;

import java.sql.SQLException;
import java.text.ParseException;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {

//    UserDaoProxyInterfaceImpl userDao = new UserDaoProxyInterfaceImpl();
//UserDaoProxyInterfaceImpl userDao = new UserDaoProxyInterfaceImpl();

//    UserDao userDao = new UserDaoImpl();
//    UserDao userDao = new UserDaoProxyInterfaceImpl();

//    UserDao userDao = new UserDaoProxyExtendImpl();


    UserDao userDao = JDKProxyFactory.create(new UserDaoImpl());

    @Override
    public List<User> getUserList() throws SQLException, ClassNotFoundException, ParseException, IllegalAccessException {
//        userDao.setUserDao(new UserDaoImpl());
        return userDao.getUserList();
    }
}
